#include <stdio.h>
#include "platform.h"
#include "Xil_types.h"
#include "xparameters.h"
#include "xil_printf.h"

#define OP_BAR0  XPAR_AXI_BRAM_CTRL_0_S_AXI_BASEADDR

int show_bar0()
{
	u32   *rd_buf;
	u32    rd_dat;
    xil_printf("-----Show bar0 reg-----\n\r");
	rd_buf = (u32 *) OP_BAR0;  // bar0 ram
	rd_dat = *rd_buf ;  // slot, 0xb8300000
	xil_printf("slot = 0x%X\r\n",rd_dat);
	rd_dat = * (rd_buf + 2);  // base clk, 0xb8300008
	xil_printf("base = 0x%X\r\n",rd_dat);
	rd_dat = *(rd_buf + 0x104/4);  // tx_req, 0xb8300104
	xil_printf("tx_req = 0x%X\r\n",rd_dat);
	rd_dat = *(rd_buf + 0x108/4);  // rx_req, 0xb8300108
	xil_printf("rx_req = 0x%X\r\n",rd_dat);
	rd_dat = *(rd_buf + 0x110/4);  // temp , 0xb8300110
	xil_printf("dat = 0x%X\r\n",rd_dat);
	return 0;
}
